﻿
using Dapper;
using HBase;
using HBase.db;
using System;
using System.Data;

namespace hCommand {
    /**
   *┌────────────────────────────────────────────────┐
   *│　描    述：Component                                                    
   *│　作    者：sgj                                              
   *│　版    本：1.0                                              
   *│　创建时间：2020/9/2 11:28:16                        
   *└────────────────────────────────────────────────┘
   **/
    public class StockDeleteBSEngine<CS> : GkTransaction where CS : AbsCoreStock {
        public long stockId;


        protected override TransRes Execute() {

            CS cs = getById<CS>(stockId);
            if (cs == null) {
                return new TransRes(stockId + "不存在!"); 
            }

            if (!BUtil.eq(cs.status, StockStatus.空闲)) {
                return new TransRes(stockId + "操作中不能删除!"); 
            } 
            cs.changeTime = DateTime.Now;
            cs.status = (int)StockStatus.异常删除; 
            update(cs);
 
            return afterIntask(cs, cs.locId);
        }


        protected virtual TransRes afterIntask(CS cs, int oldLoc) {
            
            return new TransRes();
        }
    }
}
